<%@ page language="java" contentType="text/html; charset=utf8"
	pageEncoding="utf8"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf8">
	<title><spring:message code="label.titlePreOrder" /></title>
</head>
<body>

<a href="<c:url value="/" />">
	<spring:message code="label.home" />
</a>
  
<h2><spring:message code="label.titleBaseOrder" /></h2>


<c:if test="${!empty baseOrderAttribute}">
<h1>Edit Existing Record</h1>

<c:url var="saveUrl" value="edit?id=${baseOrderAttribute.baseorderId}" />
<form:form modelAttribute="baseOrderAttribute" method="POST" action="${saveUrl}">
	<table>
		<tr>
			<td><form:label path="baseorderId">Id:</form:label></td>
			<td><form:input path="baseorderId" disabled="true"/></td>
		</tr>
	
		<tr>
			<td><form:label path="snBaseOrder">snBaseOrder:</form:label></td>
			<td><form:input path="snBaseOrder"/></td>
		</tr>

		<tr>
			<td><form:label path="statusBaseOrder">statusBaseOrder</form:label></td>
			<td><form:input path="statusBaseOrder"/></td>
		</tr>
		
		<tr>
			<td><form:label path="invoice">invoice</form:label></td>
			<td><form:input path="invoice"/></td>
		</tr>
	</table>
	
	<input type="submit" value="Save" />
</form:form>
<h3><spring:message code="label.orders" /></h3>
<c:if test="${!empty orderList}">
	<table class="data" style="border: 1px solid; border-width:1px;">
		<tr>
			<th><spring:message code="label.userId" /></th>
			<th><spring:message code="label.sn" /></th>
			<th><spring:message code="label.color" /></th>
			<th><spring:message code="label.sizeProd" /></th>	
			<th><spring:message code="label.priceProd" /></th>
			<th><spring:message code="label.urlProd" /></th>	
			<th><spring:message code="label.orderStatus" /></th>												
			<th>&nbsp;</th>
		</tr>
		<c:forEach items="${orderList}" var="order">
			<tr>
				<td>111</td>			
				<td>${order.sn}</td>
				<td>${order.color}</td>
				<td>${order.sizeProd}</td>
				<td>${order.priceProd}</td>
				<td>${order.urlProd}</td>	
				<td>${order.orderStatus}</td>							
			</tr>
		</c:forEach>
	</table>
</c:if>

<hr />
<h3><spring:message code="label.preorders" /></h3>
<c:if test="${!empty preorderList}">
	<table class="data" style="border: 1px solid; border-width:1px;">
		<tr>
			<th><spring:message code="label.userId" /></th>
			<th><spring:message code="label.sn" /></th>
			<th><spring:message code="label.color" /></th>
			<th><spring:message code="label.sizeProd" /></th>	
			<th><spring:message code="label.priceProd" /></th>
			<th><spring:message code="label.urlProd" /></th>	
			<th><spring:message code="label.preOrderStatus" /></th>												
			<th>&nbsp;</th>
		</tr>
		<c:forEach items="${preorderList}" var="preorder">
			<tr>
				<td>${preorder.userId}</td>			
				<td>${preorder.sn}</td>
				<td>${preorder.color}</td>
				<td>${preorder.sizeProd}</td>
				<td>${preorder.priceProd}</td>
				<td>${preorder.urlProd}</td>	
				<td>${preorder.preOrderStatus}</td>							
				<td><a href="addPreOrderToOrder?pid=${baseOrderAttribute.baseorderId}&preOrderId=${preorder.id}"><spring:message code="label.addpreordertoorder" /></a></td>
			</tr>
		</c:forEach>
	</table>
</c:if>
</c:if>


</body>
</html>